<!--/**
*情侣空间*
*
* @author LWG
* @date 2022/9/21 9:45
* @since 1.0.0
*/-->
<template>
    <div class="neirong">
        <div class="box">
            <h1>情侣空间</h1>
            <van-image round width="80px" height="80px" src="https://s1.328888.xyz/2022/08/05/uNr20.jpg" />
            <div class="con">
                <!-- tock -->
                <h3>{{ userinfo.phone }}</h3>
                <h3></h3>
                <div class="box2">对着《时光源》宣誓<br>爱你一万年</div>
            </div>
            <van-image round width="80px" height="80px" src="https://s1.328888.xyz/2022/09/21/2Y6d5.jpg" />
            <div class="fenlei">
                <div v-for="(item, index) in fenlei" :key="index">
                    <h3>12</h3>
                    <span>{{ item }}</span>
                </div>
            </div>
            <div class="wode">
                <!--  相爱时间： -->
                <van-grid :border="false" :column-num="3">
                    <van-grid-item>
                        <van-image src="https://s1.328888.xyz/2022/08/05/uNr20.jpg" round/>
                    </van-grid-item>
                    <van-grid-item>
                        <van-count-down :time="time" format="距离相恋3周年 DD 天 HH 时Love mm 分 ss 秒" />
                    </van-grid-item>
                    <van-grid-item>
                        <van-image src="https://s1.328888.xyz/2022/09/21/2Y6d5.jpg" round/>
                    </van-grid-item>
                </van-grid>
            </div>
        </div>
        <div class="bot">
            <div class="bot_list" is="router-link" :to="'/homeview/help/helppage'">
                <div>
                    <van-icon name="like-o" />同心援助
                </div>
                <div class="bot_right">></div>
            </div>
            <div class="bot_list" is="router-link" :to="'/address'">
                <div>
                    <van-icon name="location-o" />第一次相遇
                </div>
                <div class="bot_right">></div>
            </div>
            <div class="bot_list">
                <div>
                    <van-icon name="balance-pay" />情侣币
                </div>
                <div class="bot_right">剩余200U币></div>
            </div>
            <div class="bot_list">
                <div>
                    <van-icon name="goods-collect-o" />同心锁
                </div>
                <div class="bot_right">></div>
            </div>
            <div class="bot_list">
                <div>
                    <van-icon name="diamond-o" />三生石
                </div>
                <div class="bot_right">></div>
            </div>
            <div class="bot_list">
                <div>
                    <van-icon name="hot-o" />一起学习
                </div>
                <div class="bot_right">></div>
            </div>
            <div class="bot_list" @click="tuichu">
                <div>
                    <van-icon name="share-o" />退出空间
                </div>
                <div class="bot_right">></div>
            </div>
        </div>
    </div>
</template>
  
<script>
import { Dialog } from "vant";
import { Toast } from 'vant';
import { getCurUserId, checktoken } from "../../../../request/api";
export default {
    data() {
        return {
            time: 30 * 60 * 60 * 1000,
            fenlei: ["说说", "同心", "礼堂", "祝福板"],
            userinfo: [],
        };
    },
    mounted() {
        getCurUserId();
        let userinfoObj = localStorage["appUser"]
            ? JSON.parse(localStorage["appUser"])
            : "";
        this.userinfo = userinfoObj;
        // console.log(userinfoObj.phone);
        // console.log(userinfoObj.avatarurl);
        //验证token是否有效
        checktoken()
            .then((d) => {
                if (d.data.code != 200) {
                    this.$router.push('/login')
                }
            })
            .catch((e) => {
                console.log(e);
            });
    },
    methods: {
        tuichu() {
            Dialog.confirm({
                title: "",
                message: "确认退出吗？",
            })
                .then(() => {
                    Toast.loading({
                        duration: 1000,
                        message: "退出成功...",
                        forbidClick: true,
                    });
                    setTimeout(() => {
                        history.go(-1)
                        /*localStorage.clear();*/
                    }, 1000)
                })
                .catch((e) => {
                });
        },
    },
};
</script>
  
<style scoped>
.bot a {
    color: black;
}

.van-icon {
    color: #ff6345;
    margin-right: 7px;
}

.bot_list {
    display: flex;
    padding: 10px 0;
}

.bot_list div {
    flex: 1;
}

.bot_right {
    text-align: right;
}

.bot {
    font-size: 18px;
    background-color: white;
    margin-top: 70px;
    padding: 0 20px;
}

.neirong {
    background-color: #f2f2f2;
    height: 90vh;
}

.box {
    width: 100vw;
    height: 40vh;
    background-image: linear-gradient(to bottom, #ff6345, #ff887d);
    position: relative;
}

.box h1 {
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 48px;
    text-align: center;
}

.con {
    height: 50px;
    display: inline-block;
}

.con h3 {
    color: white;
    font-size: 19px;
    line-height: 35px;
}

.box2 {
    text-align: center;
    color: white;
    /* line-height: 20px; */
    font-size: 14px;
    width: 150px;
    border: 1px white solid;
}

.van-image {
    margin: 0 15px;
}

.fenlei {
    margin-bottom: 100px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fenlei div {
    color: white;
    font-size: 14px;
    text-align: center;
    flex: 1;
}

.fenlei div h3 {
    margin-top: 20px;
    margin-bottom: 5px;
}

.wode {
    width: 94vw;
    height: 15vh;
    background-color: white;
    position: absolute;
    left: 11px;
    bottom: -55px;
    margin-top: 10px;
}

.wode h2 {
    display: inline-block;
    font-weight: bold;
    margin: 10px 0 0 10px;
}

.wode div {
    display: flex;
}

.wode div span {
    font-weight: bold;
    line-height: 50px;
    text-align: center;
    font-size: 20px;
    flex: 1;
}
</style>
  